<template>
  <el-row :gutter="20">
    <el-col :span="24"><vue-ueditor-wrap v-model="content" :config="editorConfig" /></el-col>
  </el-row>
</template>

<script>
import VueUeditorWrap from 'vue-ueditor-wrap'
export default {
  components: { VueUeditorWrap },
  props: {
    value: [String, undefined, null]
  },
  watch: {
    value (val) {
      this.content = val
    },
    content (val) {
      this.$emit('input', val)
    }
  },
  data () {
    return {
      content: this.value,
      editorConfig: {
        // 初始容器高度
        initialFrameHeight: 500,
        // 初始容器宽度
        initialFrameWidth: '100%',
        // 访问 UEditor 静态资源的根路径，可参考 https://hc199421.gitee.io/vue-ueditor-wrap/#/faq
        UEDITOR_HOME_URL: '/static/UEditor/',
        // 服务端接口（这个地址是我为了方便各位体验文件上传功能搭建的临时接口，请勿在生产环境使用！！！）
        serverUrl: 'http://localhost:8000/static/UEditor/php/controller.php'
      }

    }
  }
}
</script>
